﻿
Namespace LightSwitchApplication

    Public Class SourceManagement

        Private Sub SourceManagement_InitializeDataWorkspace(saveChangesTo As System.Collections.Generic.List(Of Microsoft.LightSwitch.IDataService))
            ' Write your code here.
            If Me.SourceID.HasValue Then
                Me.SourceProperty = Me.Source
            Else
                Me.SourceProperty = New Source()
            End If

        End Sub

        Private Sub SourceManagement_Saved()
            ' Write your code here.
            Me.Close(False)
            Application.Current.ShowDefaultScreen(Me.SourceProperty)
        End Sub

        Private Sub OrderHeadersAddAndEditNew_CanExecute(ByRef result As Boolean)
            ' Write your code here.

        End Sub

        Private Sub OrderHeadersAddAndEditNew_Execute()
            ' Write your code here.
            Me.Application.ShowOrderManagement(Nothing)
        End Sub

        Private Sub OrderHeadersEditSelected_CanExecute(ByRef result As Boolean)
            ' Write your code here.

        End Sub

        Private Sub OrderHeadersEditSelected_Execute()
            Me.Application.ShowOrderManagement(Me.OrderHeaders.SelectedItem.Id) ' Write your code here.

        End Sub

        Private Sub NewSource_Execute()
            ' Write your code here.
            Me.SourceProperty = New Source()
        End Sub
    End Class

End Namespace